from api.ihrm_login_api import IHRMLoginApi


class TokenUtil:

    # 封装获取token的方法
    @classmethod
    def get_token(cls):
        body = {"mobile": "13800000002", "password": "123456"}
        resp = IHRMLoginApi.login(body)
        # 提取令牌token
        token = resp.json().get("data")
        return token


if __name__ == '__main__':
    token = TokenUtil.get_token()
    print(token)
